﻿

create proc dbo.GetAccountingDataFromTestingDB
as
begin
	set nocount on

	SET XACT_ABORT ON

	begin tran

	delete accounting.AccountsStructure

	delete accounting.mnAccount2Company

	insert into accounting.AccountsStructure (AccountID, AccountNumber, AccountName)
	select	a.AccountID,
			a.AccountNumber,
			a.AccountName
	from	Torprofi_Testing.accounting.AccountsStructure a

	insert into accounting.mnAccount2Company (AccountID, OrgKey)
	select	a.AccountID,
			a.OrgKey
	from	Torprofi_Testing.accounting.mnAccount2Company a

	commit

end
GO
GRANT EXECUTE
    ON OBJECT::[dbo].[GetAccountingDataFromTestingDB] TO PUBLIC
    AS [dbo];

